package com.laowang.project.system.service.impl;

import java.util.List;

import com.laowang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.laowang.project.system.mapper.TbAccountDetailMapper;
import com.laowang.project.system.domain.TbAccountDetail;
import com.laowang.project.system.service.TbAccountDetailService;

/**
 * 账户详情Service业务层处理
 *
 * @author laowang
 * @date 2022-12-29
 */
@Service
public class TbAccountDetailServiceImpl implements TbAccountDetailService {
    @Autowired
    private TbAccountDetailMapper tbAccountDetailMapper;

    /**
     * 查询账户详情
     *
     * @param detailId 账户详情ID
     * @return 账户详情
     */
    @Override
    public TbAccountDetail selectTbAccountDetailById(String detailId) {
        return tbAccountDetailMapper.selectTbAccountDetailById(detailId);
    }

    /**
     * 查询账户详情列表
     *
     * @param tbAccountDetail 账户详情
     * @return 账户详情
     */
    @Override
    public List<TbAccountDetail> selectTbAccountDetailList(TbAccountDetail tbAccountDetail) {
        return tbAccountDetailMapper.selectTbAccountDetailList(tbAccountDetail);
    }

    /**
     * 新增账户详情
     *
     * @param tbAccountDetail 账户详情
     * @return 结果
     */
    @Override
    public int insertTbAccountDetail(TbAccountDetail tbAccountDetail) {
        tbAccountDetail.setCreateTime(DateUtils.getNowDate());
        return tbAccountDetailMapper.insertTbAccountDetail(tbAccountDetail);
    }

    /**
     * 修改账户详情
     *
     * @param tbAccountDetail 账户详情
     * @return 结果
     */
    @Override
    public int updateTbAccountDetail(TbAccountDetail tbAccountDetail) {
        return tbAccountDetailMapper.updateTbAccountDetail(tbAccountDetail);
    }

    /**
     * 批量删除账户详情
     *
     * @param detailIds 需要删除的账户详情ID
     * @return 结果
     */
    @Override
    public int deleteTbAccountDetailByIds(String[] detailIds) {
        return tbAccountDetailMapper.deleteTbAccountDetailByIds(detailIds);
    }

    /**
     * 删除账户详情信息
     *
     * @param detailId 账户详情ID
     * @return 结果
     */
    @Override
    public int deleteTbAccountDetailById(String detailId) {
        return tbAccountDetailMapper.deleteTbAccountDetailById(detailId);
    }
}
